<?php
namespace wxml\widgets;

use Yii;
use yii\base\Widget;


class UserSettingSlideBarMenuWidget extends Widget {

    public $menuTree;
    public $index=0;
    public $options = ['class' => 'table table-striped table-bordered detail-view'];

    public function init() {
        parent::init();
        //@formatter:off
        $this->menuTree = [
            ['name'=>'我的信息','link'=>'index'],
            ['name'=>'我的头像','link'=>'avatar'],
            ['name'=>'账号安全','link'=>'security'],
            ['name'=>'我的钱包','link'=>'wallet'],
        ];
        //@formatter:on

    }
    public function setIndex($index=0){
        $this->index=$index;
    }

    public function run() {
        return $this->render('/widgets/user_setting_slide_bar_menu',['menu'=>$this->menuTree,'index'=>$this->index]);
    }


}
